*     *****************************************************************   *;
*     *****************************************************************   *; 
*   Date:          December 27, 2021                               	      *;
*   Authors:       Lisa Dellmuth and Jonas Tallberg				          *;   
*   Purpose: 	   Analyses for book Legitimacy Politics: Elite  		  *;
*    Communication and Public Opinion in Global Governance (CUP, 2023)    *;
*     ****************************************************************    *;
*     ****************************************************************    *;

*     ****************************************************************    *;
*     Appendix P														  *;
*     ****************************************************************    *;

 
use ch6_final.dta, clear

tab news
tab discuss
tab trust
tab lr
tab confgov
tab goveff
tab govdem
tab govfair
tab interest_un
tab interest_imf
tab q12a_result, nol
recode q12a_result 3=.
recode q12b_result 3=.
tab edu
tab age
tab gender

ttest news , by(t_dem_p_in) 
ttest news , by(t_tech_p_in) 
ttest news , by(t_fair_p_in)   
ttest news , by(t_dem_p_out) 
ttest news , by(t_tech_p_out) 
ttest news , by(t_fair_p_out)   

ttest discuss , by(t_dem_p_in) 
ttest discuss , by(t_tech_p_in) 
ttest discuss , by(t_fair_p_in)   
ttest discuss , by(t_dem_p_out) 
ttest discuss , by(t_tech_p_out) 
ttest discuss , by(t_fair_p_out)   

ttest trust , by(t_dem_p_in) 
ttest trust , by(t_tech_p_in) 
ttest trust , by(t_fair_p_in)   
ttest trust , by(t_dem_p_out) 
ttest trust , by(t_tech_p_out) 
ttest trust , by(t_fair_p_out)   

ttest lr , by(t_dem_p_in) 
ttest lr , by(t_tech_p_in) 
ttest lr , by(t_fair_p_in)   
ttest lr , by(t_dem_p_out) 
ttest lr , by(t_tech_p_out) 
ttest lr , by(t_fair_p_out)   

ttest confgov , by(t_dem_p_in) 
ttest confgov , by(t_tech_p_in) 
ttest confgov , by(t_fair_p_in)   
ttest confgov , by(t_dem_p_out) 
ttest confgov , by(t_tech_p_out) 
ttest confgov , by(t_fair_p_out)   

ttest goveff , by(t_dem_p_in) 
ttest goveff , by(t_tech_p_in) 
ttest goveff , by(t_fair_p_in)   
ttest goveff , by(t_dem_p_out) 
ttest goveff , by(t_tech_p_out) 
ttest goveff , by(t_fair_p_out)   

ttest govdem , by(t_dem_p_in) 
ttest govdem , by(t_tech_p_in) 
ttest govdem , by(t_fair_p_in)   
ttest govdem , by(t_dem_p_out) 
ttest govdem , by(t_tech_p_out) 
ttest govdem , by(t_fair_p_out)   
 
ttest govfair , by(t_dem_p_in) 
ttest govfair , by(t_tech_p_in) 
ttest govfair , by(t_fair_p_in)   
ttest govfair , by(t_dem_p_out) 
ttest govfair , by(t_tech_p_out) 
ttest govfair , by(t_fair_p_out)   
 
ttest interest_un , by(t_dem_p_in) 
ttest interest_un , by(t_tech_p_in) 
ttest interest_un , by(t_fair_p_in)   
ttest interest_un , by(t_dem_p_out) 
ttest interest_un , by(t_tech_p_out) 
ttest interest_un , by(t_fair_p_out)   
 
ttest interest_imf , by(t_dem_p_in) 
ttest interest_imf , by(t_tech_p_in) 
ttest interest_imf , by(t_fair_p_in)   
ttest interest_imf , by(t_dem_p_out) 
ttest interest_imf , by(t_tech_p_out) 
ttest interest_imf , by(t_fair_p_out)   
 
ttest q12a_result , by(t_dem_p_in) 
ttest q12a_result , by(t_tech_p_in) 
ttest q12a_result , by(t_fair_p_in)   
ttest q12a_result , by(t_dem_p_out) 
ttest q12a_result , by(t_tech_p_out) 
ttest q12a_result , by(t_fair_p_out)   
 
ttest q12b_result , by(t_dem_p_in) 
ttest q12b_result , by(t_tech_p_in) 
ttest q12b_result , by(t_fair_p_in)   
ttest q12b_result , by(t_dem_p_out) 
ttest q12b_result , by(t_tech_p_out) 
ttest q12b_result , by(t_fair_p_out)   
 
ttest edu , by(t_dem_p_in) 
ttest edu , by(t_tech_p_in) 
ttest edu , by(t_fair_p_in)   
ttest edu , by(t_dem_p_out) 
ttest edu , by(t_tech_p_out) 
ttest edu , by(t_fair_p_out)   
 
ttest age , by(t_dem_p_in) 
ttest age , by(t_tech_p_in) 
ttest age , by(t_fair_p_in)   
ttest age , by(t_dem_p_out) 
ttest age , by(t_tech_p_out) 
ttest age , by(t_fair_p_out)   
 
ttest gender , by(t_dem_p_in) 
ttest gender , by(t_tech_p_in) 
ttest gender , by(t_fair_p_in)   
ttest gender , by(t_dem_p_out) 
ttest gender , by(t_tech_p_out) 
ttest gender , by(t_fair_p_out)   
 


	
	
	

*     ****************************************************************    *;
*     Appendix Q														  *;
*     ****************************************************************    *;


use ch6_final.dta, clear

*Contingent on government confidence?


reg conf i.t_dem_p_in##c.confgov if country== 4 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.confgov if country== 4  [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.confgov if country== 4  [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.confgov  if country== 4  [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.confgov if country== 4  [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.confgov  if country== 4 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.1_phi.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
reg conf i.t_dem_p_in##c.confgov if country== 2 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.confgov if country== 2 [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.confgov if country== 2 [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.confgov if country== 2  [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.confgov if country== 2 [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.confgov if country== 2 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.1_us.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
reg conf i.t_dem_p_in##c.confgov if country== 1 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.confgov if country== 1 [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.confgov if country== 1 [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.confgov  if country== 1 [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.confgov if country== 1 [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.confgov if country== 1 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.1_ger.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
reg conf i.t_dem_p_in##c.confgov if country== 3 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.confgov if country== 3 [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.confgov if country== 3 [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.confgov  if country== 3 [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.confgov if country== 3  [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.confgov if country== 3 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.1_zaf.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
 
*Contingent on political interest in IOs?


reg conf i.t_dem_p_in##c.interest_un if io==1 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.interest_un if io==1  [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.interest_un if io==1  [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.interest_un  if io==1  [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.interest_un if io==1  [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.interest_un  if io== 1 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.2_unsc.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
reg conf i.t_dem_p_in##c.interest_un if io== 2 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.interest_un if io== 2 [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.interest_un if io== 2 [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.interest_un if io== 2  [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.interest_un if io== 2 [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.interest_un if io== 2 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.2_unfccc.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
 
reg conf i.t_dem_p_in##c.interest_imf if io== 3 [aweight=weight], cluster(RecordNo) 
eststo demp

reg conf i.t_tech_p_in##c.interest_imf if io== 3 [aweight=weight], cluster(RecordNo) 
eststo techp

reg conf i.t_fair_p_in##c.interest_imf if io== 3 [aweight=weight], cluster(RecordNo)  
eststo fairp
 
reg conf i.t_dem_p_out##c.interest_imf  if io== 3 [aweight=weight], cluster(RecordNo) 
eststo demperf
 
reg conf i.t_tech_p_out##c.interest_imf if io== 3 [aweight=weight], cluster(RecordNo)  
eststo techperf

reg conf i.t_fair_p_out##c.interest_imf if io== 3 [aweight=weight], cluster(RecordNo)  
eststo fairperf

esttab demp  techp  fairp demperf techperf fairperf using tableQ.2_IMF.rtf, ///
bic scalars(N) replace b(%9.3f) t(%9.3f) starlevels(* .05 ** .01 *** .001)
 
